package ${model.packageFullName};

import jakarta.annotation.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.Table;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.io.Serializable;
import ace.cmp.spring.data.jdbc.querydsl.core.annotations.LogicDelete;
import ace.cmp.spring.graphql.core.model.GenericPageContent;
import ${model.dtoClassInfo.info.classFullName};

/**
* ${model.remark}.
*
* @author Caspar
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = ${model.dtoClassInfo.info.className}.TABLE_DESC)
@Table(${model.dtoClassInfo.info.className}.TABLE_NAME)
public class ${model.className} implements Serializable, GenericPageContent<${model.entityIdType}> {

  <#list model.fields as field>
  <#if field.javaComment??>
  /**
   * ${field.javaComment}
   */
  </#if>
  <#if field.idFlag>
  @Id
  </#if>
  <#if field.deleteFieldFlag>
  @LogicDelete
  </#if>
  <#if field.updateTimeFieldFlag>
  @LastModifiedDate
  </#if>
  <#if field.createTimeFieldFlag>
  @CreatedDate
  </#if>
  <#if field.rowVersionFieldFlag>
  @Version
  </#if>
  <#if field.nullable>
  @Nullable
  </#if>
  <#if field.stringSizeValid??>
  @Size(max = ${field.stringSizeValid})
  </#if>
  @Schema(title = ${field.remarkMeta.titleFieldName}, description = ${field.remarkMeta.descFieldName})
  private ${field.type} ${field.name};

  </#list>
}
